﻿<%@ Page Title="" Language="C#" MasterPageFile="~/main.Master" AutoEventWireup="true"
    CodeBehind="AniversariantesAdmin.aspx.cs" Inherits="Presentation.Pages.AniversariantesAdmin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $("#txtDiaMes").mask("99/99");
        }); 
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>
        Cadastro de Aniversariantes
    </h1>
    <table>
        <tr>
            <td class="style1">
                <asp:Label ID="Label1" runat="server" Text="Nome :"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtNome" MaxLength="50" runat="server" Width="231px" BorderColor="#0099FF"
                    BorderStyle="Solid" BorderWidth="1"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvNome" runat="server" Display="Dynamic" ControlToValidate="txtNome"
                    ErrorMessage="Nome." ToolTip="Campo Obrigatório." ValidationGroup="Salvar">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:Label ID="Label2" runat="server" Text="Dia/Mes(dd/mm) :"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtDiaMes" runat="server" Width="231px" MaxLength="5" BorderColor="#0099FF"
                    BorderStyle="Solid" BorderWidth="1" ClientIDMode="Static"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvDiaMes" runat="server" Display="Dynamic" ControlToValidate="txtDiaMes"
                    ErrorMessage="Dia/Mes." ToolTip="Campo Obrigatório." ValidationGroup="Salvar">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:Label ID="Label3" runat="server" Text="Matriz :"></asp:Label>
            </td>
            <td>
                <asp:CheckBox Text="Matriz" runat="server" ID="chkMatriz" Checked="true" />
            </td>
        </tr>
        <tr>
            <td colspan="2" align="right">
                <asp:Button ID="btnSalvar" runat="server" Text="Salvar" ValidationGroup="Salvar"
                    OnClick="btnSalvar_Click" />
                <asp:ValidationSummary ID="vSum" runat="server" HeaderText="Favor verificar os seguintes campos :"
                    ShowMessageBox="True" ShowSummary="False" ValidationGroup="Salvar" />
            </td>
        </tr>
    </table>
    <br />
    <br />
    <h1>
        Filtros
    </h1>
    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                Mês :
            </td>
            <td>
                <asp:TextBox runat="server" ID="txtFiltroMes" MaxLength="2" Width="43px" BorderColor="#0099FF"
                    BorderStyle="Solid" BorderWidth="1" />
            </td>
        </tr>
        <tr>
            <td>
                Igreja :
            </td>
            <td>
                <asp:DropDownList runat="server" ID="ddlIgreja" AutoPostBack="true" OnSelectedIndexChanged="ddlIgreja_SelectedIndexChanged">
                    <asp:ListItem Text="Todas" Value="" />
                    <asp:ListItem Text="Matriz" Value="true" />
                    <asp:ListItem Text="Congregação" Value="false" />
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="right">
                <asp:Button ID="btnBuscar" runat="server" Text="Buscar" OnClick="btnBuscar_Click" />
            </td>
        </tr>
    </table>
    <br />
    <br />
    <h1>
        Lista de Aniversariantes
    </h1>
    <asp:GridView ID="grvAniversariante" runat="server" AutoGenerateColumns="False" CellPadding="4"
        ForeColor="#333333" GridLines="None" Width="100%">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="Nome" HeaderText="Nome" ReadOnly="True" SortExpression="Nome">
                <ControlStyle Width="50%" />
                <HeaderStyle Width="50%" HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Nascimento" HeaderText="Dia/mes" ReadOnly="True" SortExpression="Nascimento"
                DataFormatString="{0:dd/MM}">
                <ControlStyle Width="20%" />
                <HeaderStyle Width="20%" HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="MatrizDesc" HeaderText="Matriz" ReadOnly="True" SortExpression="Matriz"
                DataFormatString="{0:Sim/Não}">
                <ControlStyle Width="10%" />
                <HeaderStyle Width="10%" HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Excluir">
                <HeaderStyle Width="20%" HorizontalAlign="Center" />
                <ItemTemplate>
                    <asp:Button Text="Excluir" CommandArgument='<%# Eval("Codigo") %>' runat="server"
                        ID="btnExcluir" OnClick="btnExcluir_Click" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
</asp:Content>
